<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script>
      //方法定义
      function f(n1, n2) {
        console.log('n1的值:' + n1)
        console.log('n2的值:' + n2)
      }
      //方法调用
      f()
      f(10)
      f(10, 20)
      f(10, 20, 30)

      function add(n1, n2) {
        return n1 + n2
      }
      var rs = add(100, 200)
      console.log('计算结果:' + rs)
    </script>
  </head>
  <body></body>
</html>
